﻿using strange.extensions.context.api;
using strange.extensions.dispatcher.eventdispatcher.api;
using strange.extensions.mediation.impl;
using UnityEngine;

public class ExitDirector : View
{
    [Inject]
    public IEventDispatcher dispatcher { get; set; }

    public void OnCollisionExit(Collision collision)//当离开碰撞
    {
        int index = Random.Range(0, 5);
        if (index == 2)
        {
            Debug.Log("得到一分！！");
            dispatcher.Dispatch(Events.GET_REWARD);//派发出一个增加分数的事件 
        }
        else
        {
            return;
        }
            
    }

}
